﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using myschoolDal;

namespace school
{
    public partial class manstucoursegradeanalysis : Form
    {
        private string term;
        private string major;
        private string source;

        public manstucoursegradeanalysis()
        {
            InitializeComponent();
        }

        private void textBox10_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "" || comboBox2.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("错误：" + bug.Class1.worng4001, "提示");
            }
            else
            {
                term = comboBox1.SelectedItem.ToString();
                major = comboBox2.SelectedItem.ToString();
                source = textBox2.Text.ToString();
                dataGridView1.DataSource = manserver.GetAllStuScores(major, term, source).Tables[0].DefaultView;

                textBox3.Text = manserver.ManGetMaxScore(major, term, source).ToString();
                textBox5.Text = manserver.ManGetMinScore(major, term, source).ToString();
                textBox9.Text = manserver.ManGetAvgScore(major, term, source).ToString();
            }
        }

        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
